package kr.hkit.androidcomplete02.ch15;

import kr.hkit.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

public class DisplayMetricsEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch15_displaymetrics);
		
		DisplayMetrics dm = getResources().getDisplayMetrics();
		String str = " widthPixels = " + dm.widthPixels + 
				"\n heightPixels = " + dm.heightPixels +
				"\n densitiyDpi = " + dm.densityDpi + 
				"\n denstity = " + dm.density +
				"\n scaleDensity = " + dm.scaledDensity +
				 "\n xdpi = " + dm.xdpi +
				 "\n ydpi = " + dm.ydpi;
		
		TextView info = (TextView)findViewById(R.id.result);
		info.setText(str);
	}
}
